package cn.touna.jss.common.config.mq;


import cn.touna.jss.common.properties.disconf.TobaccoProperties;
import com.touna.loan.common.service.rocketmq.MQProducerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;



@Configuration
public class RocketMqConfiguration {



    @Autowired
    TobaccoProperties tobaccoProperties;



    /**生产者使用懒加载形式*/
    @Bean(name="rocketmqProducer",initMethod = "start", destroyMethod = "shutdown")
    @Lazy
    public MQProducerImpl getMQProducerImpl(){
          return new MQProducerImpl(tobaccoProperties.getGroup());
    }



}
